<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            list-style: none;
        }

        ul li {
            float: left;
            width: 50px;
            height: 20px;
            padding: 15px;
        }

        .two {
            color: #fe9800;
        }

        .four {
            color: #ff0000;
        }
    </style>
</head>

<body>
    <ul>
        <!-- <li>苹果</li>
        <li class="two">香蕉</li>
        <li>芒果</li>
        <li class="four">西瓜</li> -->
    </ul>
    <script src="../jquery-1.11.3.min.js"></script>
    <script>
        var str = ""
        for (var i = 0; i < 4; i++) {
            str += `
             <li class="${i!==0&&i!==2?(i==1 ? 'four':'two'):""}">苹果</li>`
        }
        $("ul").append(str)
        var a = 3;
        var b = a === 1 ? '是1' : (a === 2 ? '是2' : '不是1也不是2')
        console.log(b); //不是1也不是2
    </script>
</body>
</html>